{% extends "user/base.html" %}
{% load crispy_forms_tags %}
{% load staticfiles %}

{% block title %}
Register
{% endblock %}

{% block headline %}
Register
{% endblock %}

{% block breadcrumb %}
<li class="current">
  <a href="#">Register</a>
</li>
{% endblock %}

{% block content %}

<div class="row">
  <div class="large-12 columns">
    {% if not user.is_authenticated %}
    <div class="section-container auto" data-section>
    <section class="active">
      <div class="content" data-section-content>
        <div class="row">
          <div class="large-12 columns">
            {% if error %}
            {{ error }}
            {% endif %}
              {% crispy register_form %}
            </div>
          </div>
        </div>
      </section>

    </div>
    {% else %}
    <p>
      You're already connected.
    </p>
    {% endif %}
  </div>
</div>

{% endblock %}

{% block last_body %}
<script>
    $(document).foundation({
        abide : {
            patterns: {
                username: /^[a-zA-Z0-9_\.]{3,30}$/,
                password : /^.+$/,
            }
        }
    });

    
    $('#registration').on('invalid', function() {
        return false;
    });
</script>
{% endblock %}
